﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using DTO_QLNS;

namespace GUI_QLNS
{
    public partial class ucBookPreview : UserControl
    {
        private BookDTO _Book;

        private void LoadBookContent()
        {
            lblName.Text = _Book.BookName;
            lblAuthor.Text = _Book.Author.AuthorName;
            lblPublisher.Text = _Book.Publisher.PublishName;
            lblPrize.Text = _Book.CurrentPrice.ToString();
            txtShortContent.Text = _Book.Content;
            pbImage.ImageLocation = _Book.ImagePath;
        }

        public BookDTO Book
        {
            get { return _Book; }
            set
            {
                _Book = value;
                LoadBookContent();
            }
        }

        public ucBookPreview(BookDTO book)
        {
            InitializeComponent();

            Book = book;
        }

    }
}
